<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录页面</title>
<link rel="stylesheet" type="text/css" href="../../css/common.css">
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript">
   function login(){
	   var username=$("#username").val();
	   var password=$("#password").val();
	   $.ajax({
		   url:"../../rainbow/login",
		   type:"post",
		   data:JSON.stringify({username:username,password:password}),
		   contentType:"application/json;charset=UTF-8",
		   dataType:"json",
		   success:function(data){
			   if(data!=null){
				   window.location.href="productlist.html";
			   }
		   },
		   error:function(data){
			   alert("账号或密码错误，请重新输入！");
		   }
	   });
   }
</script>
</head>
<body>
    <div class="top-header">
    <div class="section">
        <div class="top-header-left f-left">
            <a href="#">LOGO</a>
        </div>
        <div class="top-header-right f-right">
            <a href="login.html">登录</a>
            <a href="html/fore/register.html">注册</a>
            <a href="../back/login-admin.html">后台</a>
        </div>
    </div>
</div>

<div class="section nav-header">
    <ul class="nav-menus f-left">
        <li><a href="login.html" class="active">首页</a></li>
        <li ><a href="productlist.html">商品列表</a></li>
        <li><a href="cart.html">购物车</a></li>
        <li><a href="user.html">用户中心</a></li>
    </ul> 
    <div class="f-right nav-right">
        <input type="text" name="search" class="seacher-input f-left" placeholder="输入关键字">
        <input type="submit" class="seacher-but  f-left" value="搜索">
    </div>
</div>


<div class="section">
    <div class="nav-tit">
        <a class="selected" href="javascript:;">账户登录</a>
        <i>|</i>
        <a href="register.html">免费注册</a>
    </div>

    <form class="login-box">
        <div class="input-box">
            <input id="username" name="username" type="text" placeholder="用户名/手机/邮箱" maxlength="50">
        </div>
        <div class="input-box">
            <input id="password" name="password" type="password" placeholder="输入登录密码" maxlength="16">
        </div>
        <div class="btn-box">
            <input type="button" value="立即登录" onclick="login()">
        </div>
    </form>
</div>


<div class="section qitian-main">
    <img src="../../images/qitian.png">
</div>
  </body>
</html>